<template>
  <div>
    <el-card>
      <div class="father" :class="{end: !$slots.left}">
        <!-- 如果传了要显示，如果没传不显示 -->
        <!-- v-show原理是改display:none，一样不会占位置 -->
        <div v-if="$slots.left" class="left-box">
          <div class="left-content">
            <i class="el-icon-info" />
            <slot name="left" />
          </div>
        </div>

        <div class="right-box">
          <slot name="right" />
        </div>
      </div>
    </el-card>
  </div>
</template>

<script>
export default {
}
</script>

<style lang="scss" scoped>
.father {
  display: flex;
  justify-content: space-between;
  align-items: center;

  &.end {
    justify-content: flex-end;
  }

  .left-content {
    padding: 5px 10px;
    border: 1px solid #91d5ff;
    border-radius: 2px;
    background-color: #e6f7ff;
    font-size: 14px;
    display: flex;
    align-items: center;
    i {
      color: #409eff;
    }
  }
}
</style>
